from datetime import timedelta


lab_con_part2_1 = {
    "title": "模型说明",
}

lab_con_part2_2 = {
    "title": "数据模块",
    "list": "数据名称",
    "button": "加载数据",
}

lab_con_part2_3 = {
    "title": "策略模块",
    "label": "战法",
}

lab_con_part2_4 = {
    "title": "因子模块",
    "label1": "策略内因子",
    "label2": "附加因子",
    "button": "计算因子"
}

lab_con_part2_5 = {
    "title": "回测模块",
    "button1": "开始回测",
    "button2": "整合订单"
}

IntervalMap = {
    'SECOND': timedelta(seconds=1),
    'SECOND2': timedelta(seconds=2),
    'SECOND3': timedelta(seconds=3),
    'SECOND4': timedelta(seconds=4),
    'SECOND5': timedelta(seconds=5),
    'SECOND6': timedelta(seconds=6),
    'SECOND10': timedelta(seconds=10),
    'SECOND12': timedelta(seconds=12),
    'SECOND15': timedelta(seconds=15),
    'SECOND20': timedelta(seconds=20),
    'SECOND30': timedelta(seconds=30),
    'MINUTE': timedelta(minutes=1),
    'MINUTE2': timedelta(minutes=2),
    'MINUTE3': timedelta(minutes=3),
    'MINUTE4': timedelta(minutes=4),
    'MINUTE5': timedelta(minutes=5),
    'MINUTE6': timedelta(minutes=6),
    'MINUTE10': timedelta(minutes=10),
    'MINUTE12': timedelta(minutes=12),
    'MINUTE15': timedelta(minutes=15),
    'MINUTE20': timedelta(minutes=20),
    'MINUTE30': timedelta(minutes=30),
    'HOUR': timedelta(hours=1),
    'HOUR2': timedelta(hours=2),
    'HOUR3': timedelta(hours=3),
    'HOUR4': timedelta(hours=4),
    'HOUR6': timedelta(hours=6),
    'HOUR8': timedelta(hours=8),
    'HOUR12': timedelta(hours=12),
    'DAILY': timedelta(hours=24)
}

IndicatorDescribe = {
    "总收益率": "最后净值相对初始净值的涨幅",
    "夏普比率": "夏普比率变体，视单个节点为一天",
    "最大回撤": "本次回测最大风险",
    "平均持仓": "单笔交易平均时长",
    "交易数量": "...",
    "单笔利润率":  "平均每笔订单的利润率",
    "盈利交易数量": "...",
    "亏损交易数量": "...",
    "累计盈利": "盈利交易的总盈利",
    "累计亏损": "亏损交易的总亏损",
    "盈亏比": "盈利订单总盈利与亏损订单总亏损的比值",
    "交易胜率": "盈利订单数量占总订单数量的比例",
}

VariableDc: dict = {
        "selected": True,
        "strategy_direction": 1,
        "lab_var_part2_1": {
            "title": "",
            "sub_title": ""
        },
        "lab_var_part2_2": {
            "selected_data_ls": [],
            "show_data": "",
            "execute": False
        },
        "lab_var_part2_3": {
            "selected_tactics_ls": [],
            "filter_ls": [],
            "open_ls": [],
            "close_ls": [],
            "execute": False
        },
        "lab_var_part2_4": {
            "tactics_factor_ls": [],
            "execute": False
        },
        "lab_var_part2_5": {
            "parallel_task_count": 0,
            "progress": {},
            "datetime_ls": [],
            "close_ls": [],
            "value_ls": [],
            "pos_ls": [],
            "profit_ls": [],
            "holding_ls": [],
            "indicator_ls": [],
            "describe_text": "",
            "execute": False
        }
}



